\(\int \frac {(c (d \sec (e+f x))^p)^n}{a+b \sec (e+f x)} \, dx\) [240]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (warning: unable to verify)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 27, antiderivative size = 206 \[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{a+b \sec (e+f x)} \, dx=-\frac {b \operatorname {AppellF1}\left (\frac {1}{2},\frac {n p}{2},1,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right ) f}+\frac {a \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-1+n p),1,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right ) f} \]

[Out]

-b*AppellF1(1/2,1/2*n*p,1,3/2,sin(f*x+e)^2,a^2*sin(f*x+e)^2/(a^2-b^2))*(cos(f*x+e)^2)^(1/2*n*p)*(c*(d*sec(f*x+
e))^p)^n*sin(f*x+e)/(a^2-b^2)/f+a*AppellF1(1/2,1/2*n*p-1/2,1,3/2,sin(f*x+e)^2,a^2*sin(f*x+e)^2/(a^2-b^2))*cos(
f*x+e)*(cos(f*x+e)^2)^(1/2*n*p-1/2)*(c*(d*sec(f*x+e))^p)^n*sin(f*x+e)/(a^2-b^2)/f

Rubi [A] (verified)

Time = 0.63 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {4033, 3954, 2902, 3268, 440} \[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{a+b \sec (e+f x)} \, dx=\frac {a \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (n p-1),1,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )}-\frac {b \sin (e+f x) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n \operatorname {AppellF1}\left (\frac {1}{2},\frac {n p}{2},1,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )} \]

[In]

Int[(c*(d*Sec[e + f*x])^p)^n/(a + b*Sec[e + f*x]),x]

[Out]

-((b*AppellF1[1/2, (n*p)/2, 1, 3/2, Sin[e + f*x]^2, (a^2*Sin[e + f*x]^2)/(a^2 - b^2)]*(Cos[e + f*x]^2)^((n*p)/
2)*(c*(d*Sec[e + f*x])^p)^n*Sin[e + f*x])/((a^2 - b^2)*f)) + (a*AppellF1[1/2, (-1 + n*p)/2, 1, 3/2, Sin[e + f*
x]^2, (a^2*Sin[e + f*x]^2)/(a^2 - b^2)]*Cos[e + f*x]*(Cos[e + f*x]^2)^((-1 + n*p)/2)*(c*(d*Sec[e + f*x])^p)^n*
Sin[e + f*x])/((a^2 - b^2)*f)

Rule 440

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
 -q, 1 + 1/n, (-b)*(x^n/a), (-d)*(x^n/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rule 2902

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[a, Int[(d*
Sin[e + f*x])^n/(a^2 - b^2*Sin[e + f*x]^2), x], x] - Dist[b/d, Int[(d*Sin[e + f*x])^(n + 1)/(a^2 - b^2*Sin[e +
 f*x]^2), x], x] /; FreeQ[{a, b, d, e, f, n}, x] && NeQ[a^2 - b^2, 0]

Rule 3268

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff
 = FreeFactors[Cos[e + f*x], x]}, Dist[(-ff)*d^(2*IntPart[(m - 1)/2] + 1)*((d*Sin[e + f*x])^(2*FracPart[(m - 1
)/2])/(f*(Sin[e + f*x]^2)^FracPart[(m - 1)/2])), Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b - b*ff^2*x^2)^p,
x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] &&  !IntegerQ[m]

Rule 3954

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Dist[Sin[
e + f*x]^n*(d*Csc[e + f*x])^n, Int[(b + a*Sin[e + f*x])^m/Sin[e + f*x]^(m + n), x], x] /; FreeQ[{a, b, d, e, f
, n}, x] && NeQ[a^2 - b^2, 0] && IntegerQ[m]

Rule 4033

Int[((c_.)*((d_.)*sec[(e_.) + (f_.)*(x_)])^(p_))^(n_)*((a_.) + (b_.)*sec[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol]
 :> Dist[c^IntPart[n]*((c*(d*Sec[e + f*x])^p)^FracPart[n]/(d*Sec[e + f*x])^(p*FracPart[n])), Int[(a + b*Sec[e
+ f*x])^m*(d*Sec[e + f*x])^(n*p), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] &&  !IntegerQ[n]

Rubi steps \begin{align*} \text {integral}& = \left ((d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {(d \sec (e+f x))^{n p}}{a+b \sec (e+f x)} \, dx \\ & = \left (\cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{1-n p}(e+f x)}{b+a \cos (e+f x)} \, dx \\ & = -\left (\left (a \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{2-n p}(e+f x)}{b^2-a^2 \cos ^2(e+f x)} \, dx\right )+\left (b \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{1-n p}(e+f x)}{b^2-a^2 \cos ^2(e+f x)} \, dx \\ & = \frac {\left (b \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{-\frac {n p}{2}}}{-a^2+b^2+a^2 x^2} \, dx,x,\sin (e+f x)\right )}{f}-\frac {\left (a \cos ^{n p+2 \left (\frac {1}{2}-\frac {n p}{2}\right )}(e+f x) \cos ^2(e+f x)^{-\frac {1}{2}+\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (1-n p)}}{-a^2+b^2+a^2 x^2} \, dx,x,\sin (e+f x)\right )}{f} \\ & = -\frac {b \operatorname {AppellF1}\left (\frac {1}{2},\frac {n p}{2},1,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right ) f}+\frac {a \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-1+n p),1,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right ) f} \\ \end{align*}

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(5411\) vs. \(2(206)=412\).

Time = 32.62 (sec) , antiderivative size = 5411, normalized size of antiderivative = 26.27 \[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{a+b \sec (e+f x)} \, dx=\text {Result too large to show} \]

[In]

Integrate[(c*(d*Sec[e + f*x])^p)^n/(a + b*Sec[e + f*x]),x]

[Out]

Result too large to show

Maple [F]

\[\int \frac {\left (c \left (d \sec \left (f x +e \right )\right )^{p}\right )^{n}}{a +b \sec \left (f x +e \right )}d x\]

[In]

int((c*(d*sec(f*x+e))^p)^n/(a+b*sec(f*x+e)),x)

[Out]

int((c*(d*sec(f*x+e))^p)^n/(a+b*sec(f*x+e)),x)

Fricas [F]

\[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{a+b \sec (e+f x)} \, dx=\int { \frac {\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{b \sec \left (f x + e\right ) + a} \,d x } \]

[In]

integrate((c*(d*sec(f*x+e))^p)^n/(a+b*sec(f*x+e)),x, algorithm="fricas")

[Out]

integral(((d*sec(f*x + e))^p*c)^n/(b*sec(f*x + e) + a), x)

Sympy [F]

\[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{a+b \sec (e+f x)} \, dx=\int \frac {\left (c \left (d \sec {\left (e + f x \right )}\right )^{p}\right )^{n}}{a + b \sec {\left (e + f x \right )}}\, dx \]

[In]

integrate((c*(d*sec(f*x+e))**p)**n/(a+b*sec(f*x+e)),x)

[Out]

Integral((c*(d*sec(e + f*x))**p)**n/(a + b*sec(e + f*x)), x)

Maxima [F]

\[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{a+b \sec (e+f x)} \, dx=\int { \frac {\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{b \sec \left (f x + e\right ) + a} \,d x } \]

[In]

integrate((c*(d*sec(f*x+e))^p)^n/(a+b*sec(f*x+e)),x, algorithm="maxima")

[Out]

integrate(((d*sec(f*x + e))^p*c)^n/(b*sec(f*x + e) + a), x)

Giac [F]

\[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{a+b \sec (e+f x)} \, dx=\int { \frac {\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{b \sec \left (f x + e\right ) + a} \,d x } \]

[In]

integrate((c*(d*sec(f*x+e))^p)^n/(a+b*sec(f*x+e)),x, algorithm="giac")

[Out]

integrate(((d*sec(f*x + e))^p*c)^n/(b*sec(f*x + e) + a), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{a+b \sec (e+f x)} \, dx=\int \frac {{\left (c\,{\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^p\right )}^n}{a+\frac {b}{\cos \left (e+f\,x\right )}} \,d x \]

[In]

int((c*(d/cos(e + f*x))^p)^n/(a + b/cos(e + f*x)),x)

[Out]

int((c*(d/cos(e + f*x))^p)^n/(a + b/cos(e + f*x)), x)